Manage Eats orders
EatManager
Manage Eats orders.
class yandex_b2b_go.eat.EatManager
Attributes
-
EatOrderManager — order management.
order: EatOrderManager
EatOrderManager
Manage orders.
class yandex_b2b_go.eat.EatOrderManager
Method
- list — gets a list of employee orders by their
ID.
List
Gets a list of employee orders by their ID.
async def list(
user_ids: EatsOrdersListRequest,
limit: Optional[int] = None,
cursor: Optional[str] = None,
since_datetime: Optional[str] = None,
till_datetime: Optional[str] = None,
since_date: Optional[str] = None,
till_date: Optional[str] = None,
sorting_order: Optional[SortingOrder] = None
) -> EatOrderListResponse
Parameters
user_ids— list of employee IDs. Class EatsOrdersListRequest.limit— number of displayed orders. If this parameter is not specified, information about the first 150 orders is returned.cursor— request marker (returned in the body of response to the previous request). The parameter is not required for the first page, but is required for subsequent pagessince_datetime— the search includes orders made starting from this .till_datetime— the search includes orders made before this date and time.since_date— the search includes orders made starting from this date.till_date— the search includes orders made no later than this date.sorting_order— sorting order. Class SortingOrder.
If successful, returns the EatOrderListResponse class.
If the parameters are incorrect, the method returns the ValidationError error.
If the response code is not 200, an error is returned: ApiError.
Request example
import asyncio
from yandex_b2b_go import Client
from yandex_b2b_go import EatManager
from yandex_b2b_go import typing, errors
TOKEN = '<your token>'
async def main():
client = Client(token=TOKEN)
eat_manager = EatManager(client=client)
try:
user_ids = typing.EatsOrdersListRequest(user_ids=['b201...a4bc'])
orders = await eat_manager.order.list(
user_ids=user_ids
)
...
except errors.ValidationError as e:
return str(e.args)
except errors.ApiError as e:
return e
asyncio.run(main())
Was the article helpful?
Previous
Next